import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class FileFilter {

	public static void main(String[] args) throws FileNotFoundException,
			UnsupportedEncodingException {
		File file = new File("c:\\123.txt");
		int l=(int) file.length();
		byte[] tempbytes = new byte[l];		
		int i=0;
		InputStream in = new FileInputStream(file);

		try {
			while ((i = in.read(tempbytes)) != -1) {
			}
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		String s = new String(tempbytes,"GBK");

		Pattern pattern = Pattern.compile("\\s*|t|r|n");
		Matcher matcher= pattern.matcher(s);
		
		System.out.print(s + "\n" +matcher.matches());

	}
}
